<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    // es5的属性增强写法
    const name = "kobe";
    const age = 13;
    const run = function () {
        console.log(this)
    }

    const obj = {
        name: name,
        age: age,
        run: run
    }
    obj.run()

    // es6的属性增强写法
    const name1 = "Dowson";
    const age1 = 16;
    const run1 = function () {
        console.log(this)
    }

    const obj1 = {
        name1,
        age1,
        run1
    }
    obj1.run1()
    // -------------------------------------------
    // es5函数写法
    const es5 = {
        say: function () {
            console.log("我是es5")
        }
    }
    es5.say();

    const es6 = {
        say() {
            console.log("我是es6")
        }
    }
    es6.say();
</script>

</html>